home *** CD-ROM | disk | FTP | other *** search
- onEnterFrame = function()
- {
- scripts.charX = Math.floor(_X / tileW);
- scripts.charY = Math.floor(_Y / tileH);
- var _loc2_ = 0;
- if(Key.isDown(37))
- {
- _loc2_ = 1;
- }
- if(Key.isDown(38))
- {
- _loc2_ = 2;
- }
- if(Key.isDown(39))
- {
- _loc2_ = 4;
- }
- if(Key.isDown(40))
- {
- _loc2_ = 8;
- }
- if(Key.isDown(32))
- {
- eventFire();
- }
- if(scripts.gameOn && scripts.attacking == false && scripts.gamePaused == false)
- {
- switch(_loc2_)
- {
- case 0:
- if(char.myDir == "left")
- {
- this.art.gotoAndStop("ready_left");
- }
- if(char.myDir == "right")
- {
- this.art.gotoAndStop("ready_right");
- }
- if(char.myDir == "up")
- {
- this.art.gotoAndStop("ready_up");
- }
- if(char.myDir == "down")
- {
- this.art.gotoAndStop("ready_down");
- }
- break;
- case 1:
- eventLeft();
- break;
- case 2:
- eventUp();
- break;
- case 4:
- eventRight();
- break;
- case 8:
- eventDown();
- }
- }
- };
-